public class divide_by_zero {
  public static void devide() {
    int a = 10;
    int b = 0;

    // 缺陷示例：整数除以零
    int result = a / b; // 这里会抛出 ArithmeticException
    System.out.println("结果: " + result);

    // 浮点数除以零的情况
    double x = 10.0;
    double y = 0.0;
    double resultDouble = x / y; // 不会抛异常，会得到 Infinity
    System.out.println("浮点数结果: " + resultDouble);
  }
}
